home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / OpenDoc / Interfaces / CPlusPlus / ODDesc.xh < prev    next >
Encoding:
Text File  |  1997-02-13  |  4.7 KB  |  224 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: ODDesc.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  *  Classes defined in this interface
  13.  * 
  14.  */
  15.  
  16.  
  17. #ifndef SOM_ODDesc_xh
  18. #define SOM_ODDesc_xh
  19.  
  20. class ODDesc;
  21.  
  22. #define ODDesc_MajorVersion 1
  23. #define ODDesc_MinorVersion 0
  24.  
  25. /* C++ SOM defs */
  26. #include <somcls.xh>
  27. #include <somcm.xh>
  28.  
  29. /* C++ parent defs */
  30. #ifndef SOM_ODObject_xh
  31. #include <ODObject.xh>
  32. #endif
  33.  
  34. #ifndef ODDesc_API
  35. #define ODDesc_API
  36. /*
  37.  * -- The Class API
  38.  */
  39.  
  40. /*
  41.  * Start of user-defined types:
  42.  */
  43. class SOMClass;
  44. class SOMObject;
  45. class ODFrame;
  46. class ODFacet;
  47. class ODObject;
  48. class ODExtension;
  49. class ODDesc;
  50.  
  51. /*
  52.  * End of user-defined types.
  53.  */
  54.  
  55. #ifdef OLDIBMSOMAPISUPPORT
  56. #define ODDescCClassData ODDescClassData
  57. #define ODDescNewClass(major,minor) somNewVersionedClassReference(ODDesc,major,minor)
  58. #endif
  59.  
  60. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  61. #define ODDescMetaClass SOMClass
  62.  
  63. #if PRAGMA_ALIGN_SUPPORTED
  64. #  pragma options align=power
  65. #endif
  66.  
  67. /* The API to the ODDesc class object, and the methods it introduces. */
  68. SOMEXTERN struct ODDescClassDataStructure {
  69. #ifdef OLDIBMSOMAPISUPPORT
  70.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  71. #else
  72.     long zero;
  73. #endif
  74.     somStaticClassInfo *sci;
  75.     somDToken        instanceDataToken;
  76.     long reserved [3];
  77.     somMToken InitODDesc;
  78.     somMToken SetDescType;
  79.     somMToken SetRawData;
  80.     somMToken GetDescType;
  81.     somMToken GetRawData;
  82. } SOMDLINK ODDescClassData;
  83.  
  84. #if PRAGMA_ALIGN_SUPPORTED
  85. #  pragma options align=reset
  86. #endif
  87.  
  88. #if !defined(ODDesc_Class_Source) && !defined(SOM_Module_oddesc_Source)
  89. #if PRAGMA_IMPORT_SUPPORTED
  90. #pragma import list ODDescClassData
  91. #endif
  92. #endif
  93.  
  94.  
  95. /*
  96.  * -- Typedefs and inline method declarations for left path inherited methods
  97.  * -- are omitted because this compilation had -museinheritedmethods in effect
  98.  */
  99.  
  100.  
  101. /*
  102.  * -- Typedefs for ODDesc Method Procedures
  103.  */
  104. SOMEXTERN {
  105. typedef void   (* SOMLINK somTD_ODDesc_InitODDesc)(ODDesc *somSelf, Environment *ev);
  106. typedef void   (* SOMLINK somTD_ODDesc_SetDescType)(ODDesc *somSelf, Environment *ev,
  107.         ODDescType descType);
  108. typedef void   (* SOMLINK somTD_ODDesc_SetRawData)(ODDesc *somSelf, Environment *ev,
  109.         ODByteArray* data);
  110. typedef ODDescType   (* SOMLINK somTD_ODDesc_GetDescType)(ODDesc *somSelf, Environment *ev);
  111. typedef ODByteArray   (* SOMLINK somTD_ODDesc_GetRawData)(ODDesc *somSelf, Environment *ev);
  112. }
  113.  
  114. #endif /* ODDesc_API */
  115.  
  116.  
  117. /*
  118.  * -- This emitter treats Method Tokens as Thunks by default.
  119.  * -- Use the sc modifier "nothunks" to change this default
  120.  */
  121. #undef somresolve_
  122. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  123.  
  124. /*
  125.  * -- The C++ Wrapper Class for ODDesc
  126.  */
  127. class ODDesc : public ODObject
  128. {
  129. public:
  130.  
  131. // ODDesc::new registers use of the class object, and then uses somNew
  132. // to allocate memory and load the object method table pointer. 
  133. void *operator new(size_t size)
  134. {
  135.     SOM_IgnoreWarning(size);
  136.     // Allocate memory using the default allocator for ODDesc, and
  137.     // clear mem & set method table pointer, call basic initialization
  138. #ifdef SOMCHKNULL
  139.     void * __somResult = (void *)
  140.       somNewObject(ODDesc);
  141.     SOMCHKNULL(__somResult);
  142.     return __somResult;
  143. #else
  144.     return (void*) somNewObject(ODDesc);
  145. #endif
  146. }
  147.  
  148. // ODDesc::delete uses the default deallocator for the object's class.
  149. void operator delete(void * obj)
  150. {
  151.     if (obj) {
  152.         SOM_Resolve(obj,SOMObject,somFree)
  153.            ( (SOMObject*) obj );
  154.     }
  155. }
  156.  
  157. /* method: InitODDesc */
  158. void   InitODDesc(Environment *ev)
  159. {
  160.    SOM_ResolveD(this,ODDesc,ODDesc,InitODDesc)
  161.     (this,ev);
  162. #ifdef SOMCHKEXCEPT
  163.       SOMCHKEXCEPT;
  164. #endif
  165. }
  166.  
  167. /* method: SetDescType */
  168. void   SetDescType(Environment *ev,
  169.         ODDescType descType)
  170. {
  171.    SOM_ResolveD(this,ODDesc,ODDesc,SetDescType)
  172.     (this,ev,descType);
  173. #ifdef SOMCHKEXCEPT
  174.       SOMCHKEXCEPT;
  175. #endif
  176. }
  177.  
  178. /* method: SetRawData */
  179. void   SetRawData(Environment *ev,
  180.         ODByteArray* data)
  181. {
  182.    SOM_ResolveD(this,ODDesc,ODDesc,SetRawData)
  183.     (this,ev,data);
  184. #ifdef SOMCHKEXCEPT
  185.       SOMCHKEXCEPT;
  186. #endif
  187. }
  188.  
  189. /* method: GetDescType */
  190. ODDescType   GetDescType(Environment *ev)
  191. {
  192.    #ifdef SOMCHKEXCEPT
  193.    ODDescType __somResult = 
  194.       SOM_ResolveD(this,ODDesc,ODDesc,GetDescType)
  195.     (this,ev);
  196.       SOMCHKEXCEPT;
  197.    return __somResult;
  198. #else
  199.    return SOM_ResolveD(this,ODDesc,ODDesc,GetDescType)
  200.     (this,ev);
  201. #endif
  202. }
  203.  
  204. /* method: GetRawData */
  205. ODByteArray   GetRawData(Environment *ev)
  206. {
  207.    #ifdef SOMCHKEXCEPT
  208.    ODByteArray __somResult = 
  209.       SOM_ResolveD(this,ODDesc,ODDesc,GetRawData)
  210.     (this,ev);
  211.       SOMCHKEXCEPT;
  212.    return __somResult;
  213. #else
  214.    return SOM_ResolveD(this,ODDesc,ODDesc,GetRawData)
  215.     (this,ev);
  216. #endif
  217. }
  218.  
  219. };   /* ODDesc */
  220.  
  221.  
  222.  
  223. #endif       /* SOM_ODDesc_xh */
  224.